package com.rykj.widget.indicator;

import androidx.viewpager.widget.ViewPager;

/**
 * @version 1.0 * @aduthor JFSL * @date 2016/11/13 0013
 */
public abstract class IndicatorListener implements ViewPager.OnPageChangeListener {
    @Override
    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        scrollChanged(position, positionOffset);
    }

    @Override
    public void onPageSelected(int position) {
        selected(position);
    }

    @Override
    public void onPageScrollStateChanged(int state) {
    }

    /**
     * 选择当前页 * @param position
     */
    public abstract void selected(int position);

    /**
     * ViewPager滑动 * @param position * @param offset
     */
    public abstract void scrollChanged(int position, float offset);
}
